package day04;
import java.util.Scanner;
public class CommandBySwitchDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能:1.查询 2.存款 3.取款 4.退卡");
        int command = scan.nextInt();
        if (command==1){
            System.out.println("查询业务...");
        }else if (command==2){
            System.out.println("存款业务...");
        }else if (command==3){
            System.out.println("取款业务...");
        }else if (command==4){
            System.out.println("退卡业务...");
        }else{
            System.out.println("输入错误...");
        }

        /*
        switch (command){
            case 1:
                System.out.println("查询业务...");
                break;
            case 2:
                System.out.println("存款业务...");
                break;
            case 3:
                System.out.println("取款业务...");
                break;
            case 4:
                System.out.println("退卡业务...");
                break;
            default:
                System.out.println("输入错误...");
        }
         */
    }

    public static class Guessing {
        public static void main(String[] args) {
            //注意：选择几路结构，不是看干几件事，而是看有几种情况
            Scanner scan = new Scanner(System.in);
            int num = 250;//(带数300(大)/200(小)/250(对))
            System.out.println("猜吧!");
            int guess = scan.nextInt();
            while (guess != num) {
                if (guess > num) {
                    System.out.println("猜大了!");
                } else {
                        System.out.println("猜小了!");
                }
                System.out.println("猜吧!");
                guess = scan.nextInt();
            }
            System.out.println("恭喜您猜对了!");
        }
    }
}
